package com.itheima.jobs;

import com.alibaba.dubbo.config.annotation.Reference;
import com.itheima.service.ClearOrderSettingService;
import com.itheima.utils.DateUtils;

import java.util.Date;

/*
*
* 定时清理预约设置历史信息
*
* */
public class ClearOrderSettingTimeJobs {

    /*远程注入定时清理业务对象*/
    @Reference
    private ClearOrderSettingService clearOrderSettingService;
    public void ClearOrderSettingTimeJob(){
///
       try{
           Date date = new Date();
           String orderDate = DateUtils.parseDate2String(date);
           clearOrderSettingService.clearOrderSettingTimeJob(orderDate);
           System.out.println("定时清理预约设置信息执行了...");
       }catch (Exception e){
           e.printStackTrace();
           System.out.println("定时清理预约设置信息失败了...");
       }
    }
}
